
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Figure 4.a %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 

y=[-1.649 4.372 0.898 -5.892 -3.724 -6.553; -5.308 -5.230 -4.710 -2.986 -4.821 -7.033]; 
v=y.*0.284;

% Create subplot


figure1 = subplot(2,1,1);

X=1:6;
h1=bar(X(1),y(1,1));
hold on;
h2=bar(X(2),y(1,2));
hold on;
h3=bar(X(3),y(1,3));
hold on;
h4=bar(X(4),y(1,4));
hold on;
h5=bar(X(5),y(1,5));
hold on;
h6=bar(X(6),y(1,6));

set(h1,'LineStyle','--','LineWidth',1, 'FaceColor',  [0.9 0.9 0.9]);
set(h2,'LineStyle','-','LineWidth',3, 'FaceColor', [0.95 0.95 0.95]);
set(h3,'LineStyle','--','LineWidth',1, 'FaceColor', [0.99 0.9 0.9]);
set(h4,'LineStyle','-','LineWidth',3, 'FaceColor', [0.9 0.999 0.9]);
set(h5,'LineStyle','-','LineWidth',3, 'FaceColor', [0.9 0.9 0.99]);
set(h6,'LineStyle','--','LineWidth',1, 'FaceColor', [0.99 0.99 0.9]);



set(gca, 'XTick',[]);
hold on;

yyaxis left;

ylabel('\fontsize{12} Value of DID Coefficient','FontSize',12,...
    'FontName','Times New Roman', 'position',[-0.5 -8 0]);
ylim([-7.0423  7.0423]);

title('\fontsize{12} Overall Impact-- Cumulative Earnings','FontSize',12,...
    'FontName','Times New Roman');

set(gca, 'YTick',[-5 -3 -1 1 3 5], 'FontSize',8,'LineWidth',1.25);
yyaxis right;
ylabel('expressed in Pre-Shock Annual Wage','FontSize',12,...
    'FontName','Times New Roman',  'position',[7.5 -2.7 0], 'Color',[0 0 0]);
ylim([ -2   2]);


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
hold on
figure2 = subplot(2,1,2);
h1=bar(X(1),y(2,1));
hold on;
h2=bar(X(2),y(2,2));
hold on;
h3=bar(X(3),y(2,3));
hold on;
h4=bar(X(4),y(2,4));
hold on;
h5=bar(X(5),y(2,5));
hold on;
h6=bar(X(6),y(2,6));

set(h1,'LineStyle','-','LineWidth',3, 'FaceColor',  [0.9 0.9 0.9]);
set(h2,'LineStyle','-','LineWidth',3, 'FaceColor', [0.95 0.95 0.95]);
set(h3,'LineStyle','-','LineWidth',3, 'FaceColor', [0.99 0.9 0.9]);
set(h4,'LineStyle','-','LineWidth',3, 'FaceColor', [0.9 0.999 0.9]);
set(h5,'LineStyle','-','LineWidth',3, 'FaceColor', [0.9 0.9 0.99]);
set(h6,'LineStyle','-','LineWidth',3, 'FaceColor', [0.99 0.99 0.9]);
set(gca, 'XTick',[]);
hold on;


yyaxis left;
ylim([-7.1  0]);
title('\fontsize{12} Initial Impact-- Cumulative Earnings at the Initial Firm','FontSize',12,...
    'FontName','Times New Roman');

set(gca,'FontSize',8,'LineWidth',1.25)
yyaxis right;
% ylabel('\fontsize{12} in Pre-Shock', 'Initial Annual Wage','FontSize',11,...
%     'FontName','Times New Roman');
ylim([ -2.0164   0]);



% % Create textbox
annotation('textbox',...
    [0.185178571428571 0.737819775868773 0.135338345864662 0.066815144766147],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Managers'},...
    'LineStyle','none');
% 
% Create textbox
annotation('textbox',...
    [0.294642857142857 0.652343585392583 0.102756892230576 0.066815144766147],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Professionals', '& Technicians'},...
    'LineStyle','none');
% 
% Create textbox
annotation('textbox',...
    [0.400508771929824 0.835024498886414 0.12781954887218 0.066815144766147],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Clerks &', 'Service', 'Workers'},...
    'LineStyle','none');
% 
% Create textbox
annotation('textbox',...
    [0.520050125313282 0.785748329621381 0.140350877192982 0.066815144766147],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Craft', 'Workers'},...
    'LineStyle','none');
% 
% Create textbox
annotation('textbox',...
    [0.621553884711777 0.692652561247215 0.161654135338346 0.155902004454343],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Machine','Operators'},...
    'LineStyle','none');
% 
annotation('textbox',...
    [0.741553884711777 0.672652561247215 0.161654135338346 0.155902004454343],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Labourers'},...
    'LineStyle','none');

set(gca,'FontSize',8,'LineWidth',1.25)

%uncomment to save it as pdf
% h=gca ;
% saveas(h, 'Figure4a.jpg');

clf('reset');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Figure 4.b %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 

%Occupation-employment in the service and initial

y=[3.287 4.261 2.660 3.371 2.752 3.197; -4.700 -4.273 -3.326 -3.048 -4.380 -3.876]; 
v=y.*0.284;


figure1 = subplot(2,1,1);
X=1:6;
h1=bar(X(1),y(1,1));
hold on;
h2=bar(X(2),y(1,2));
hold on;
h3=bar(X(3),y(1,3));
hold on;
h4=bar(X(4),y(1,4));
hold on;
h5=bar(X(5),y(1,5));
hold on;
h6=bar(X(6),y(1,6));

set(h1,'LineStyle','-','LineWidth',3, 'FaceColor',  [0.9 0.9 0.9]);
set(h2,'LineStyle','-','LineWidth',3, 'FaceColor', [0.95 0.95 0.95]);
set(h3,'LineStyle','-','LineWidth',3, 'FaceColor', [0.99 0.9 0.9]);
set(h4,'LineStyle','-','LineWidth',3, 'FaceColor', [0.9 0.999 0.9]);
set(h5,'LineStyle','-','LineWidth',3, 'FaceColor', [0.9 0.9 0.99]);
set(h6,'LineStyle','-','LineWidth',3, 'FaceColor', [0.99 0.99 0.9]);




set(gca, 'XTick',[]);
hold on;

yyaxis left;

ylabel('\fontsize{12} Value of DID Coefficient','FontSize',12,...
    'FontName','Times New Roman', 'position',[-0.5 -2.0 0]);
ylim([0  7.0423]);

title('\fontsize{12}  Cumulative Employment at the Service Sector','FontSize',12,...
    'FontName','Times New Roman');

set(gca, 'YTick',[-5 -3 -1 1 3 5], 'FontSize',8,'LineWidth',1.25);
yyaxis right;
ylabel('expressed in Years','FontSize',12,...
    'FontName','Times New Roman',  'position',[7.5 -0.5 0], 'Color',[0 0 0]);
ylim([ 0   2]);


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
hold on
figure2 = subplot(2,1,2);
h1=bar(X(1),y(2,1));
hold on;
h2=bar(X(2),y(2,2));
hold on;
h3=bar(X(3),y(2,3));
hold on;
h4=bar(X(4),y(2,4));
hold on;
h5=bar(X(5),y(2,5));
hold on;
h6=bar(X(6),y(2,6));

set(h1,'LineStyle','-','LineWidth',3, 'FaceColor',  [0.9 0.9 0.9]);
set(h2,'LineStyle','-','LineWidth',3, 'FaceColor', [0.95 0.95 0.95]);
set(h3,'LineStyle','-','LineWidth',3, 'FaceColor', [0.99 0.9 0.9]);
set(h4,'LineStyle','-','LineWidth',3, 'FaceColor', [0.9 0.999 0.9]);
set(h5,'LineStyle','-','LineWidth',3, 'FaceColor', [0.9 0.9 0.99]);
set(h6,'LineStyle','-','LineWidth',3, 'FaceColor', [0.99 0.99 0.9]);





set(gca, 'XTick',[]);
hold on;

yyaxis left;
ylim([-7.0423  0]);


title('\fontsize{12} Initial Impact-- Cumulative Employment at the Initial Firm','FontSize',12,...
    'FontName','Times New Roman');

set(gca,'FontSize',8,'LineWidth',1.25)
yyaxis right;
ylim([ -2   0]);

% % Create textbox
annotation('textbox',...
    [0.185178571428571 0.737819775868773 0.135338345864662 0.06681514],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Managers'},...
    'LineStyle','none');
% 
% Create textbox
annotation('textbox',...
    [0.294642857142857 0.86343585392583 0.102756892230576 0.06681514],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Professionals', '& Technicians'},...
    'LineStyle','none');
% 
% Create textbox
annotation('textbox',...
    [0.410 0.767024498886414 0.12781954887218 0.066815],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Clerks &', 'Service', 'Workers'},...
    'LineStyle','none');
% 
% Create textbox
annotation('textbox',...
    [0.520050125313282 0.785748329621381 0.140350877192982 0.06681],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Craft', 'Workers'},...
    'LineStyle','none');
% 
% Create textbox
annotation('textbox',...
    [0.621553884711777 0.672 0.161654135338346 0.15590],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Machine','Operators'},...
    'LineStyle','none');
% 
annotation('textbox',...
    [0.741553884711777 0.66 0.16165 0.15590],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Labourers'},...
    'LineStyle','none');

set(gca,'FontSize',8,'LineWidth',1.25)
% 
% h=gca;
% saveas(h, 'Figure4b.jpg');

clf('reset');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Figure 4.c %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 


y=[-1.386 1.149 -0.192 -2.886 -3.785 -0.809; -4.825 -4.534 -3.981 -3.087 -4.750 -5.247]; 
v=y.*0.284;

figure1 = subplot(2,1,1);

X=1:6;
h1=bar(X(1),y(1,1));

hold on;
h2=bar(X(2),y(1,2));

hold on;
h3=bar(X(3),y(1,3));

hold on;
h4=bar(X(4),y(1,4));

hold on;
h5=bar(X(5),y(1,5));

hold on;
h6=bar(X(6),y(1,6));

set(h1,'LineStyle','--','LineWidth',1, 'FaceColor',  [0.9 0.9 0.9]);
set(h2,'LineStyle','--','LineWidth',1, 'FaceColor', [0.95 0.95 0.95]);
set(h3,'LineStyle','--','LineWidth',1, 'FaceColor', [0.99 0.9 0.9]);
set(h4,'LineStyle','-','LineWidth',3, 'FaceColor', [0.9 0.999 0.9]);
set(h5,'LineStyle','-','LineWidth',3, 'FaceColor', [0.9 0.9 0.99]);
set(h6,'LineStyle','--','LineWidth',1, 'FaceColor', [0.99 0.99 0.9]);



set(gca, 'XTick',[]);
hold on;

yyaxis left;

ylabel('\fontsize{12} Value of DID Coefficient','FontSize',12,...
    'FontName','Times New Roman', 'position',[-0.5 -8 0]);
ylim([-7.0423  7.0423]);

title('\fontsize{12} Overall Impact-- Cumulative Hours Worked','FontSize',12,...
    'FontName','Times New Roman');

set(gca, 'YTick',[-5 -3 -1 1 3 5], 'FontSize',8,'LineWidth',1.25);
yyaxis right;
ylabel('expressed in Pre-Shock Annual Hours Worked','FontSize',12,...
    'FontName','Times New Roman',  'position',[7.5 -2.7 0], 'Color',[0 0 0]);
ylim([ -2   2]);


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
hold on
figure2 = subplot(2,1,2);
h1=bar(X(1),y(2,1));
hold on;
h2=bar(X(2),y(2,2));
hold on;
h3=bar(X(3),y(2,3));
hold on;
h4=bar(X(4),y(2,4));
hold on;
h5=bar(X(5),y(2,5));
hold on;
h6=bar(X(6),y(2,6));

set(h1,'LineStyle','-','LineWidth',3, 'FaceColor',  [0.9 0.9 0.9]);
set(h2,'LineStyle','-','LineWidth',3, 'FaceColor', [0.95 0.95 0.95]);
set(h3,'LineStyle','-','LineWidth',3, 'FaceColor', [0.99 0.9 0.9]);
set(h4,'LineStyle','-','LineWidth',3, 'FaceColor', [0.9 0.999 0.9]);
set(h5,'LineStyle','-','LineWidth',3, 'FaceColor', [0.9 0.9 0.99]);
set(h6,'LineStyle','-','LineWidth',3, 'FaceColor', [0.99 0.99 0.9]);




set(gca, 'XTick',[]);
hold on;

yyaxis left;
ylim([-7.1  0]);


title('\fontsize{12} Initial Impact-- Cumulative Hours Worked at the Initial Firm','FontSize',12,...
    'FontName','Times New Roman');

set(gca,'FontSize',8,'LineWidth',1.25)
yyaxis right;
ylim([ -2.0164   0]);



% % Create textbox
annotation('textbox',...
    [0.185178571428571 0.737819775868773 0.135338345864662 0.066815144766147],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Managers'},...
    'LineStyle','none');
annotation('textbox',...
    [0.294642857142857 0.652343585392583 0.102756892230576 0.066815144766147],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Professionals', '& Technicians'},...
    'LineStyle','none');

annotation('textbox',...
    [0.400508771929824 0.835024498886414 0.12781954887218 0.066815144766147],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Clerks &', 'Service', 'Workers'},...
    'LineStyle','none');

annotation('textbox',...
    [0.520050125313282 0.785748329621381 0.140350877192982 0.066815144766147],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Craft', 'Workers'},...
    'LineStyle','none');
annotation('textbox',...
    [0.621553884711777 0.692652561247215 0.161654135338346 0.155902004454343],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Machine','Operators'},...
    'LineStyle','none'); 
annotation('textbox',...
    [0.741553884711777 0.672652561247215 0.161654135338346 0.155902004454343],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Labourers'},...
    'LineStyle','none');

set(gca,'FontSize',8,'LineWidth',1.25)
% 
% h=gca ;
% saveas(h, 'Figure4c.jpg');

clf('reset');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Figure 4.d %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 

%Occupation: unemployment-following a spell of service employment

y=[3.395 1.725 -0.270 4.475 5.674 2.038]; 
v=y.*0.284;


figure1=figure;


X=1:6;
h1=bar(X(1),y(1,1));
hold on;
h2=bar(X(2),y(1,2));
hold on;
h3=bar(X(3),y(1,3));
hold on;
h4=bar(X(4),y(1,4));
hold on;
h5=bar(X(5),y(1,5));
hold on;
h6=bar(X(6),y(1,6));

set(h1,'LineStyle','-','LineWidth',3, 'FaceColor',  [0.9 0.9 0.9]);
set(h2,'LineStyle','--','LineWidth',1, 'FaceColor', [0.95 0.95 0.95]);
set(h3,'LineStyle','--','LineWidth',1, 'FaceColor', [0.99 0.9 0.9]);
set(h4,'LineStyle','-','LineWidth',3, 'FaceColor', [0.9 0.999 0.9]);
set(h5,'LineStyle','-','LineWidth',3, 'FaceColor', [0.9 0.9 0.99]);
set(h6,'LineStyle','--','LineWidth',1, 'FaceColor', [0.99 0.99 0.9]);




set(gca, 'XTick',[]);
hold on;

ylabel('\fontsize{12} Value of DID Coefficient','FontSize',12,...
    'FontName','Times New Roman');
ylim([-0.5  7.0423]);

title('\fontsize{12}  Cumulative Unemployment Spells within the Service Sector','FontSize',12,...
    'FontName','Times New Roman');

set(gca, 'YTick',[0 1 2 3 4 5 6], 'FontSize',8,'LineWidth',1.25);

annotation(figure1, 'textbox',...
    [0.185178571428571 0.537819775868773 0.135338345864662 0.066815144766147],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Managers'},...
    'LineStyle','none');

annotation(figure1,'textbox',...
    [0.294642857142857 0.42343585392583 0.102756892230576 0.066815144766147],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Professionals', '& Technicians'},...
    'LineStyle','none');

annotation(figure1,'textbox',...
    [0.400508771929824 0.307024498886414 0.12781954887218 0.066815144766147],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Clerks &', 'Service', 'Workers'},...
    'LineStyle','none');

annotation(figure1,'textbox',...
    [0.520050125313282 0.705748329621381 0.140350877192982 0.066815144766147],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Craft', 'Workers'},...
    'LineStyle','none');

annotation(figure1,'textbox',...
    [0.621553884711777 0.722652561247215 0.161654135338346 0.155902004454343],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Machine','Operators'},...
    'LineStyle','none');
annotation(figure1,'textbox',...
    [0.741553884711777 0.402652561247215 0.161654135338346 0.155902004454343],...
    'FontWeight','bold',...
    'FontName','Times New Roman',...
    'String',{'Labourers'},...
    'LineStyle','none');

set(gca,'FontSize',8,'LineWidth',1.25)


% h=gca ;
% saveas(h, 'Figure4d.pdf');